<a href="https://github.com/socketstream/socketstream/edit/master/src/docs/tutorials/en/start_targets.ngdoc" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><h1><code ng:non-bindable=""></code>
<div><span class="hint"></span>
</div>
</h1>
<div><div class="start-targets-page"><h2 id="start-targets">Start Targets</h2>
<p>When SocketStream is started in runs on an Orchestrator just like the build tool Gulp.</p>
<p>Note that this interface is experimental and may change</p>
<h5 id="start-targets_starting-the-server">Starting the server</h5>
<p>The <code>default</code> target will build assets and start a web server as needed. If other named targets
are specified they will be started instead.</p>
<p>To start your socketstream project with different build targets specify them after the server
object, or instead if you do not want to run the streaming server.</p>
<pre><code>// Start web server
var server = http.Server(ss.http.middleware);
server.listen(3000);

// Start SocketStream
ss.start(server,&#39;my-task&#39;,&#39;serve&#39;);
</code></pre><h5 id="start-targets_default-tasks">Default tasks</h5>
<p>The default task depends on</p>
<ul>
<li><code>pack-all</code>/<code>pack-if-needed</code> if using packed assets</li>
<li><code>live-assets</code> if not using packed assets</li>
<li><code>live-reload</code> if live reload is enabled (true by default) </li>
<li>and <code>serve-on-demand</code></li>
</ul>
<h5 id="start-targets_hooking-in">Hooking in</h5>
<p>If you want to react when things happen around tasks you can register event handlers.
The tasks are managed by Orchestrator which manages tasks in Gulp.</p>
<p>Register events on <a href="https://www.npmjs.com/package/orchestrator#orchestrator-on-event-cb">ss.api.orchestrator</a></p>
</div></div>
